import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
import Home from "../views/home/Home.vue"
Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: "",
    name: "home",
    redirect:'/home/goods',
    component: Home,
    children:[
      {
        path:'/home/goods',
        name:'goods',
        component:()=>import('../views/goods/Goods.vue')
      },
      {
        path:'/home/evaluate',
        name:'evaluate',
        component:()=>import('../views/evaluate/Evaluate.vue')
      },
      {
        path:'/home/merchant',
        name:'merchant',
        component:()=>import('../views/merchant/Merchant.vue') 
      }
    ]
  },
  // 详情页
  {
    path:'/details',
    name:'details',
    component:()=>import('../views/details/Details.vue')
  }
 
];

const router = new VueRouter({
  routes,
});

export default router;
